set more off
capture log close
cd *** Fill in path name here ***

//  program:    AnanatEtAl_household_income
//  task:		Regressions of log household income on job loss 

log using *** Fill in file name here ***, replace text

// #1 Load data
// Same household as 8th grader, ages 18-64
use AnanatEtAl_household_income_data.dta

// #2 Create logged household income variable
gen lnhhinc=ln(hhincome)
replace lnhhinc=0 if hhincome<=0

// #3 Run regression of log household income on job losses last year
ivregress 2sls lnhhinc yrd* stated* (seppctyrlag = ticpctyrlag) [w=hhwt], vce(cluster stateno) 

clear 

log close
